Recoverable fluids, such as hydrocarbons (for example, petroleum or natural gas) and water, are frequently found in subterranean formations. Production of a recoverable fluid from a subterranean formation often requires drilling onto the subterranean formation to produce a wellbore through which the recoverable fluid is brought to the surface. Wellbore fluids, for example, drilling fluids, carrier fluids and fracturing fluids to name a few, are used in the wellbore to perform multiple functions, for example, preventing the fluid influx from formation into the wellbore, removing drill cuttings and debris from the wellbore, perforating the casing, to name a few. Use of a conventional wellbore fluid having constant viscosity and density may lead to certain disadvantages. In one example, sudden changes in formation type and formation strength may lead to varying fracture gradients leading to loss of circulation. In another example, when residual drilling fluid is left behind casing in a completed well, the casing may be susceptible to collapse from sustained casing pressure (SCP) or annuar pressure buildup (APB) due to the fluid expansion behind casing. Also, use of a conventional cementing fluid may lead to poor compressibility of set cement to sustain cyclic stresses, poor cement-to-casing bond, and to formation of microannuli. Therefore, issues associated with the wellbore fluids can reduce well productivity and increase well maintenance costs.